import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter/src/widgets/placeholder.dart';
import 'package:full_display/common/qxp_color.dart';
import 'package:full_display/common/qxp_style.dart';
import 'package:full_display/provide/button_list_provider.dart';
import 'package:full_display/unit/asset_utils/asset_utils.dart';
import 'package:full_display/unit/screen/screen_utility.dart';
import 'package:full_display/unit/widgets/slider/slider_light_widget.dart';
import 'package:full_display/unit/widgets/widget_button_list.dart';
import 'package:full_display/unit/widgets/widget_media_list.dart';
import 'package:provider/provider.dart';

class CloudsSplicingDetailPage extends StatefulWidget {
  const CloudsSplicingDetailPage({super.key});

  @override
  State<CloudsSplicingDetailPage> createState() =>
      _CloudsSplicingDetailPageState();
}

class _CloudsSplicingDetailPageState extends State<CloudsSplicingDetailPage> {
  late ButtonListProvider _btnListData;
  @override
  Widget build(BuildContext context) {
    _btnListData = context.watch<ButtonListProvider>();
    return Scaffold(
      backgroundColor: ColorPlate.background,
      resizeToAvoidBottomInset: false,
      appBar: AppBar(
        backgroundColor: ColorPlate.background,
        elevation: 0,
        title: Center(
          child: Text(
            '拼接详情',
            textAlign: TextAlign.center,
            style: StandardTextStyle.textWhite16BoldStyle,
          ),
        ),
        leading: IconButton(
          icon: Image.asset(
              height: 20.0.H, width: 20.0.W, AssetUtils.getAsset2Image("back")),
          onPressed: () {
            Navigator.of(context).pop();
          },
        ),
        actions: [
          TextButton(
              onPressed: () {},
              child: Text(
                '管理',
                textAlign: TextAlign.center,
                style: StandardTextStyle.textWhite14Op75Style,
              ))
        ],
      ),
      body: SingleChildScrollView(
        padding: EdgeInsets.all(20.0.W),
        child: Column(
          children: [
            Text(
              'S6-6C2A2858AC',
              textAlign: TextAlign.center,
              style: StandardTextStyle.textWhite24BoldStyle,
            ),
            Container(
              height: 40.0.H,
            ),
            ButtonListWidget(
              btnList: _btnListData.splicInfoBtnList,
              tapAction: btnClick,
              isBg: true,
            ),
            Container(
              margin: EdgeInsets.only(top: 20.0.H),
              child: const SliderLightWidget(
                title: '亮度调节',
              ),
            ),
            Container(
              decoration: const BoxDecoration(
                color: ColorPlate.backgroundOpacity5,
                borderRadius: BorderRadius.all(Radius.circular(12.0)),
              ),
              height: 56.0.H,
              margin: EdgeInsets.only(top: 15.0.H),
              padding: EdgeInsets.only(left: 20.0.W, right: 20.0.W),
              child: InkWell(
                child: Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    Text(
                      '蓝牙设置',
                      textAlign: TextAlign.center,
                      style: StandardTextStyle.textWhite16BoldStyle,
                    ),
                    Image.asset(
                        height: 12.0.H,
                        width: 21.0.W,
                        AssetUtils.getAsset2Image("right")),
                  ],
                ),
              ),
            ),
            Container(
              margin: EdgeInsets.only(top: 15.0.H),
              child: MedisListWidget(
                info: "",
                list: [],
                h: 200,
                clearData: () {},
              ),
            ),
          ],
        ),
      ),
    );
  }

  void btnClick(int index, BuildContext context) {
    if (index == 0) {
    } else if (index == 1) {
    } else if (index == 2) {
    } else {}
  }
}
